import { useUpgradeStore } from "@/store/modules/hmi/upgrade.store";

export function useBackupList() {
  const upgradeStore = useUpgradeStore();
  
  // 查询备份信息列表
  const fetchBackupList = async () => {
    await upgradeStore.fetchBackupList();
  };

  // 暴露出一个变量，给 VIEW 层使用，等于 STORE 层的 backupList 变量的值
  const backupList = upgradeStore.backupList;

  return {
    fetchBackupList,
    backupList,
  };
}